<template>
	<view class="container">
		<uni-section title="案件信息" type="line"></uni-section>
		<case-detail :selectedCase="selectedCase"></case-detail>
		<uni-section title="本环节处理" type="line"></uni-section>
		
		<view style="padding:5px 16px">
			<uni-forms ref="baseForm" :model="caseForm" label-position="top" label-width="105">
				<uni-forms-item label="截止时间" name="endTime" >
					<uni-easyinput v-model="caseForm.currStatusEndDate" disabled placeholder="请输入截止时间"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="上一环节意见描述" name="lastDesc">
					<uni-easyinput v-model="caseForm.lastStatusExecutorOpinion" type="textarea" disabled placeholder="上一环节意见描述"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="授权对象" name="sqdx" v-if="currOper.operCode == 'O54'||currOper.operCode == 'O53'">
					<uni-easyinput v-model="infoVo.caseOrgName" disabled placeholder="授权对象"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="操作选项" name="operId">
					<view class="uni-list">
						<radio-group @change="operChange">
							<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in operListRadio" :key="item.value">
								<view style="margin-right: 10px;">
									<radio :value="item.value"/>
								</view>
								<view>{{item.label}}</view>
							</label>
						</radio-group>
					</view>
				</uni-forms-item>
				<uni-forms-item label="处置对象" name="objectUser" v-show="isShowObjectUser">
					<uni-data-select v-model="caseForm.objectUser" :localdata="objectUserArr" @change="userChange"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="常用语" name="cyy">
					<uni-data-select v-model="caseForm.cyy" :localdata="cyyOptions" @change="cyyChange"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="挂账时限" name="activateTime"  v-if="currOper.operCode == 'O54'||currOper.operCode == 'O53'">
					<uni-datetime-picker type="datetime" v-model="caseForm.activateTime" @change="gqsxChange" />
				</uni-forms-item>
				<uni-forms-item label="延期时长" name="yqTime"  v-if="currOper.operCode == 'O52'">
					<uni-datetime-picker type="datetime" v-model="caseForm.yqTime"/>
				</uni-forms-item>
				<uni-forms-item label="延时时长" name="ysTime"  v-if="currOper.operCode == 'O49'">
					<uni-datetime-picker type="datetime" v-model="caseForm.ysTime"/>
				</uni-forms-item>
				<uni-forms-item label="挂账期限" name="gztime"  v-if="infoVo.linkId == 'Activity_0kg4yzm'">
					<uni-easyinput v-model="infoVo.delayTime" disabled placeholder="请输入挂账期限"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="延期时长" name="ysTotime"  v-if="infoVo.linkId == 'Activity_1qee6xl'">
					<uni-easyinput v-model="infoVo.delayTime" disabled placeholder="请输入延期时间"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="新截止时间" name="ysTotime"  v-if="currOper.operCode == 'O63' || currOper.operCode == 'O65'">
					<uni-easyinput v-model="infoVo.delayTime" disabled placeholder="请输入截止时间"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="新截止时间" name="ysTotime" v-if="currOper.operCode == 'O64' || currOper.operCode == 'O68'">
					<uni-easyinput v-model="ysTotime" disabled placeholder="请输入截止时间"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="新截止时间" name="ysTotime" v-if="currOper.operCode == 'O66' || currOper.operCode == 'O67'">
					<uni-easyinput v-model="infoVo.time" disabled placeholder="请输入截止时间"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="病害类型" name="bhId" v-if="currOper.operCode == 'O59' || currOper.operCode == 'O60'">
					<uni-data-select v-model="caseForm.bhId" :localdata="diseaseList" :disabled="flag"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="养护单位" name="yhUnit" v-if="currOper.operCode == 'O59' || currOper.operCode == 'O60'">
					<uni-data-select v-model="caseForm.yhUnit" :localdata="userInfo" :disabled="flag"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="养护对象" name="roadId" v-if="currOper.operCode == 'O59' || currOper.operCode == 'O60'">
					<uni-data-select v-model="caseForm.roadId" :localdata="roadBridgeList" :disabled="flag"></uni-data-select>
				</uni-forms-item>
				<uni-forms-item label="养护长度" name="yhLength"  v-if="currOper.operCode == 'O60'">
					<uni-easyinput type="number" v-model="caseForm.yhLength" placeholder="请输入养护长度"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="养护费用" name="yhPrice"  v-if="currOper.operCode == 'O60'">
					<uni-easyinput type="number" v-model="caseForm.yhPrice" placeholder="请输入养护费用"></uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="处置对象" name="objectOrg" v-show="isShowObjectOrg">
					<uni-data-picker placeholder="请选择处置对象" popup-title="请选择处置对象" :localdata="objectOrgTree" v-model="caseForm.objectOrg"
						@nodeclick="orgChange">
						<view class="selected" v-if="objectOrgSelect.text">
							<view class="selected-item">
								<text>{{objectOrgSelect.text}}</text>
							</view>
						</view>
					</uni-data-picker>
				</uni-forms-item>
				<uni-forms-item label="说明" name="dealDesc">
					<uni-easyinput v-model="caseForm.dealDesc"  type="textarea" placeholder="说明">{{dealDesc}}</uni-easyinput>
				</uni-forms-item>
				<uni-forms-item label="附件" v-show="isOpenCaseDealFile">
					<uni-file-picker ref="fileUpload" limit="9" mode="grid"  title="最多选择9张图片" @select="fileUploadSelect" :auto-upload="false" @delete="deleteImg"></uni-file-picker>
				</uni-forms-item>
			</uni-forms>
			<view class="footer-btn-content">
				<button size="mini" class="common-mini-btn primary-btn" @click="handleSubmit">提交</button>
				<button size="mini" class="common-mini-btn other-btn" @click="handleCancel">取消</button>
				
			</view>
		</view>
		
	</view>
</template>

<script>
	import {getNextDept} from "@/api/dums/caw/caseRundetail";
	import {getDiseaseList} from "@/api/rb/rbDiseaseType";
	import {getRoadBridgeList} from "@/api/rb/roadBridge/roadBridge";
	import {getInfo} from '@/api/login'
	import caseDetail from '@/components/case-detail/case-detail.vue'
	import { getCaseDetail } from '@/api/dums/caw/caseInfo.js'
	import {listCaseOper} from "@/api/dums/caseconfig/amCaseOper";
	import {caseSignFor, selectCzdx, submitCaseDeal} from "@/api/dums/caw/caseSignTransact";
	import {getStateCyy} from "@/api/dums/gov/caseLanguage/amCaseLanguage";
	import {uploadCaseAndSaveTheFile} from "@/api/dums/caw/cawAttach.js"
	import { handleTree } from "@/utils/util.js"
	import {uniRequest} from "@/utils/uni-request.js"
	import { getToken } from '@/utils/auth'
	import  config from '@/config.js'
	import {toast} from '@/utils/common.js'
	export default {
		data() {
			return {
				caseId:"",
				isOpenCaseDeal: false, //签收办理弹出（无附件弹窗）
				isOpenCaseDealFile: false, //签收办理弹出（有附件弹窗）
				selectedCase:{},//案件详情
				caseForm:{
					dealDesc:""
				},
				dealDesc:"",
				operList:[],//操作选项
				currOper:{},//当前操作
				currCyy:{},//选中常用语
				infoVo:{},
				operListRadio:[],
				ysToLimittime:"",
				ysTotime:"",
				flag:false,
				isShowObjectUser:false, //处置对象控件是否显示
				objectUserArr:[], //处置对象用户
				objectUserSelect: {}, //选中的处置对象
				isShowObjectOrg:false, //处置对象控件是否显示
				objectOrgTree:[], //处置对象机构
				objectOrgSelect: {}, //选中的处置对象
				cyyOptions:[], //常用语下拉选项
				currentCyy:{}, //当前选中常用语
				diseaseList:[], //病害类型
				roadBridgeList:[],//道桥
				userInfo:[],//当前用户信息
				user:{},//当前用户信息
				filePaths: [],
			}
		},
		created(){
			this.getInfo();//当前用户信息
		},
		methods: {
			getDetailInfo(){
				getCaseDetail({caseId:this.caseId}).then(res =>{
					if(res.code == 200){
						this.selectedCase = res.data;
						this.caseForm = Object.assign({},this.selectedCase);
					}
				})
			},
			//加载病害类型选项
			getDiseaseList(){
				getDiseaseList({}).then(res=>{
					this.diseaseList = res.data.map(item=>{
						item.text = item.name;
						item.value = item.id;
						return item;
					});
				});
			},
			//加载道桥选项
			getRoadBridgeList() {
				getRoadBridgeList({}).then((res) => {
					this.roadBridgeList = res.data.map(item=>{
						item.text = item.name;
						item.value = item.id;
						return item;
					});
				});
			},
			//加载当前用户信息
			getInfo(){
				getInfo({}).then((res) => {
					res.data.user.text = res.data.user.org.orgName;
					res.data.user.value = res.data.user.orgId;
					this.userInfo.push(res.data.user);
					this.user = res.data.user;
					console.log(this.userInfo)
				});
			 },
			//查询签收办理
			caseSignFor(caseId){
				caseSignFor({caseId: caseId}).then(res => {
					if(res){
						this.infoVo = res.infoVo;
						this.operList = res.operList;
						this.operListRadio = res.operList.map(item=>{
							return {
								label: item.operName,
								value: item.operId
							};
						});
					}
				});
			},
			operChange(e){
				this.resetForm();
				let operId = e.detail.value;
				this.currOper = this.operList.filter(oper => {
					return oper.operId === operId;
				})[0];
				if(this.currOper.operCode=="O60"){
					  this.flag=true;
				  }
				if(this.currOper.operCode=="O59" || this.currOper.operCode=="O60"){
					  this.getRoadBridgeList();//道桥
					  this.getDiseaseList();//病害类型
					  this.getInfo();//当前用户信息
				}
				this.selectedCase.linkName = this.currOper.operName;
				this.getStateCyy(this.currOper.operCode); //查询环节常用语
				//如果nextDept=2或者3，调用selectCzdx接口查询处置对象 nextDept=3为人员，其他值为机构
				if(this.currOper.nextDept == 2 || this.currOper.nextDept == 3){
					if(this.currOper.nextDept == 3){
						this.isShowObjectUser = true;
						this.isShowObjectOrg = false;
					}else{
						this.isShowObjectOrg = true;
						this.isShowObjectUser = false;
					}
					selectCzdx({dictType:this.currOper.nextObjectType, caseId: this.caseForm.caseId}).then(res=>{
						if(this.currOper.nextDept == 3){
							this.objectUserArr = res.rows.map(item => {
								item.text=item.userRealName;
								item.value=item.userId;
								return item;
							});
						}else{
							let treeData = res.rows.map(item => {
								return {
									id:item.id,
									pid:item.pid,
									value:item.id,
									text:item.name,
								}
							})
							//处置对象为机构
							this.objectOrgTree = handleTree(treeData, "id","pid");
						}
					});
				}else{
					this.isShowObjectUser = false;
					this.isShowObjectOrg = false;
					//查询下一步机构
					getNextDept({nextDeptType:this.currOper.nextDept, caseId:this.caseForm.caseId}).then(res=>{
						if(res && res.data){
							if(res.data.deptId){
								this.objectUserSelect.orgId = res.data.deptId;
								this.objectUserSelect.orgName = res.data.deptName;
							}else{
								$modal.msgError("查询下一环节机构失败！");
							}
						}
					});
				}
			},
			resetForm(){
				this.cyyOptions = [];
				this.currCyy = {};
				this.objectOrgSelect = {};
				this.objectUserSelect = {};
				this.objectOrgTree = [];
				this.caseForm.cyy="";
				this.caseForm.objectUser="";
				this.caseForm.dealDesc="";
				this.dealDesc = "";
			},
			gqsxChange(e){
				console.log('挂起时限:', e);
			},
			//查询常用语
			getStateCyy(operCode){
				let param = {
					caseState: operCode,
					caseId: this.caseForm.caseId,
					inLinkId: this.currOper.inLinkId,
					startTime: this.infoVo.delayTimeTy||this.infoVo.lastStatusEndDate
				};
				getStateCyy(param).then(res => {
					if(res.cyyList){
						this.cyyOptions = res.cyyList.map(item => {
							item.text = item.langDesc;
							item.value = item.langId;
							return item
						});
					}
					this.ysToLimittime = res.ysToLimittime;
					this.ysTotime = res.ysTotime;
				});
			},
			cyyChange(e){
				this.$nextTick(() => {
					this.currCyy = this.cyyOptions.filter(item => {
						return item.langId == e;
					})[0]
					this.caseForm.dealDesc = this.currCyy.langDesc;
					this.dealDesc = this.currCyy.langDesc;
				})
			},
			userChange(e){
				this.$nextTick(() => {
					this.objectUserSelect = this.objectUserArr.filter(item => {
						return item.value === e;
					})[0];
				})
			},
			orgChange(e){
				this.objectOrgSelect = e;
			},
			handleSubmit(){
				if(!this.currOper.operCode){
					toast("请选择操作选项");
					return;
				}else if(!this.currCyy.langId){
					toast("请选择常用语");
					return;
				}else if(this.isShowObjectOrg && !this.objectOrgSelect.id){
					toast("处置对象不能为空");
					return;
				}else if(this.isShowObjectUser && !this.objectUserSelect.orgId){
					toast("处置对象不能为空");
					return;
				}else if(!this.caseForm.dealDesc){
					toast("说明不能为空");
					return;
				}
				if(this.currOper.operCode == 'O59' || this.currOper.operCode == 'O60'){
					if(!this.caseForm.bhId){
						toast("病害类型不能为空");
						return;
					}
					if(!this.caseForm.yhUnit){
						toast("养护单位不能为空");
						return;
					}
					if(!this.caseForm.roadId){
						toast("养护对象不能为空");
						return;
					}
				}
				if(this.currOper.operCode == 'O60'){
					if(!this.caseForm.yhLength){
						toast("养护长度不能为空");
						return;
					}
					if(!this.caseForm.yhPrice){
						toast("养护费用不能为空");
						return;
					}
				}
				
				if(this.filePaths && this.filePaths.length>0){
					this.fileUpload().then(res => {
						console.log(res);
						if(res && res.code == 500){
							toast(res.msg);
						}else{
							this.submitForm();
						}
					});
				}else{
					this.submitForm();
				}
			},
			handleCancel(){
				this.$tab.navigateBack();
			},
			fileUpload(){
				return new Promise((resolve,reject) => {
					this.filePaths.forEach(file => {
						uni.uploadFile({
							url: config.baseUrl+'/caw/caseAttach/uploadCaseAndSaveTheFile', //仅为示例，非真实的接口地址
							filePath: file,
							name: 'file',
							header:{
								"Authorization": "Bearer " + getToken() 
							},
							formData: {
								linkName:this.selectedCase.linkName,
								caseId:this.caseForm.caseId,
								runId:this.selectedCase.runId,
								remark: 0
							},
							success: (uploadFileRes) => {
								if(typeof uploadFileRes.data == "string" ){
									uploadFileRes.data = JSON.parse(uploadFileRes.data)
								}
								resolve(uploadFileRes.data)
							},
							fail() {
								reject()
							}
						});
					})
				})
			},
			fileUploadSelect(e){
				for (let i = 0; i < e.tempFilePaths.length; i++) {
					this.filePaths.push(e.tempFilePaths[i]);
				}
			},
			deleteImg(e) {
				for (let i = 0; i < this.filePaths.length; i++) {
					if (this.filePaths[i] == e.tempFilePath) {
						this.filePaths.splice(i, 1);
					}
				}	
			},
			submitForm(){
				let param = {};
				param.caseId = this.caseForm.caseId;
				param.caseType = this.caseForm.caseType; //案件类型
				param.checkRemark = this.caseForm.dealDesc; //办理说明  常用语
				param.checkUserType = 1; //默认"1"  处理人类型:1 监督员 , 2 视频点
				param.rptChannelId = this.caseForm.rptChannelId; //案件来源
				param.operCode = this.currOper.operCode; //案件业务操作编码
				param.remark = this.caseForm.dealDesc; //办理说明  常用语
				param.inLinkId = this.currOper.inLinkId; //原状态 操作里的inLinkId
				param.outLinkId = this.currOper.outLinkId; //目标状态  操作里的outLinkId
				param.currStatusTimeLong = this.infoVo.currStatusTimeLong; //环节时限
				if(this.infoVo.delayTimeTy){
					param.currEndTime = this.infoVo.delayTimeTy;
				}else{
					param.currEndTime = this.infoVo.time;
				}
				if(this.currOper.operCode == "O11" || this.currOper.operCode == "O25" || this.currOper.operCode == "O83" || this.currOper.operCode == "O94"
				 || this.currOper.operCode == "O71"){
					//处置对象是用户
					//派发核实
					param.checkUserId = this.objectUserSelect.userId; //发核实时选择中人的userId
					param.checkUserName = this.objectUserSelect.userName; //发核实时选择中人的userName
					param.dispDeptId = this.objectUserSelect.orgId; //派发核实时选择中人的orgId
					param.nextOrgId = this.objectUserSelect.orgId; //下一环节机构ID     派发核实时选择中人的orgId
					param.nextOrgName = this.objectUserSelect.orgName; //下一环节机构名称     派发核实时选择中人的orgName
				}else if(this.currOper.operCode == "O13" || this.currOper.operCode == "O23" || this.currOper.operCode == "O31" || this.currOper.operCode == "O41"
				 || this.currOper.operCode == "O45" || this.currOper.operCode == "O56"){
					//上下级分流
					param.nextOrgId = this.objectOrgSelect.value; //下一环节机构ID     派发核实时选择中人的orgId
					param.nextOrgName = this.objectOrgSelect.text; //下一环节机构名称     派发核实时选择中人的orgName
					if(this.currOper.operCode == "O56"){
						param.dispDeptId = this.objectOrgSelect.value;
						if(this.currCyy.ysTotime){
							param.prolongTime = parseInt(this.ysToLimittime)*60; //延时时长
						}
					}
					if(this.currOper.operCode == "O41"){
						param.dispDeptId = this.objectOrgSelect.value;
					}
				}else if(this.currOper.operCode == "O14" || this.currOper.operCode == "O21" || this.currOper.operCode == "O22" || this.currOper.operCode == "O24"
				 || this.currOper.operCode == "O32" || this.currOper.operCode == "O33" || this.currOper.operCode == "O34" || this.currOper.operCode == "O43"
				 || this.currOper.operCode == "O46" || this.currOper.operCode == "O58" || this.currOper.operCode == "O91" || this.currOper.operCode == "O92"
				 || this.currOper.operCode == "O93" || this.currOper.operCode == "O54" || this.currOper.operCode == "O55" || this.currOper.operCode == "O57"
				 || this.currOper.operCode == "O50" || this.currOper.operCode == "O51" || this.currOper.operCode == "O52" || this.currOper.operCode == "O53" || this.currOper.operCode == "O61"
				 || this.currOper.operCode == "O62" || this.currOper.operCode == "O63" || this.currOper.operCode == "O67" || this.currOper.operCode == "O64"
				 || this.currOper.operCode == "O68" || this.currOper.operCode == "O65" || this.currOper.operCode == "O66" || this.currOper.operCode == "O69"
				 || this.currOper.operCode == "O73" || this.currOper.operCode == "O79" || this.currOper.operCode == "O81" || this.currOper.operCode == "O82"
				 || this.currOper.operCode == "O91" || this.currOper.operCode == "O92" || this.currOper.operCode == "O93" || this.currOper.operCode == "O95"
				 || this.currOper.operCode == "O59" || this.currOper.operCode == "O60" || this.currOper.operCode == "O49" || this.currOper.operCode == "O74"
				 || this.currOper.operCode == "O75" || this.currOper.operCode == "O76"){
					//申请废案
					param.nextOrgId = this.objectUserSelect.orgId; //下一环节机构ID     派发核实时选择中人的orgId
					param.nextOrgName = this.objectUserSelect.orgName; //下一环节机构名称     派发核实时选择中人的orgName
					if(this.currOper.operCode == "O49"){
						 if(this.infoVo.ysCount>0){
							  this.$modal.msgError("该案件已延时，不能重复操作！");
								return;
						 }
						 param.delayTime = this.caseForm.ysTime; //延时时长
					}
					if(this.currOper.operCode == "O52"){
						if(this.currOper.outLinkId=='Activity_1qee6xl' && this.infoVo.prolongCount>0){
							this.$modal.msgError("该案件已申请延时，不能重复申请");
							return;
						}
						// if(!this.ysToLimittime || !this.ysTotime){
						// 	this.$modal.msgError("请配置案件类型时限");
						// 	return;
						// }
						param.delayTime = this.caseForm.yqTime; //延期时长
						// if(this.ysTotime){
						// 	param.prolongTime = parseInt(this.ysToLimittime)*60; //延时时长
						// }
					}
					if(this.currOper.operCode == "O53"){
						param.delayTime = this.caseForm.activateTime; //新截止时间   时间框供选择
					}
					if(this.currOper.operCode == "O64"||this.currOper.operCode == "O68"){
						param.delayTime = this.infoVo.ysTotime; //缓办时间 infoVo.delayTime
					}
					if(this.currOper.operCode == "O66"){
						param.activateTime = this.infoVo.delayTime; //缓办时间 infoVo.delayTime
					}
					if(this.currOper.operCode == "O65"){
						param.activateTime = this.infoVo.delayTime; //缓办时间 infoVo.delayTime
						param.delayTime = this.infoVo.delayTime; //挂起时限 infoVo.delayTime
					}
					if(this.currOper.operCode == "O63"){
						param.delayTime = this.infoVo.delayTime; //新截止时间   infoVo.delayTime
					}
					if(this.currOper.operCode == "O67"){
						 param.delayTime = this.infoVo.time; //新截止时间   infoVo.time
					 }
					if(this.currOper.operCode == "O54"){
						param.activateTime = this.caseForm.activateTime; //挂起时限
						param.delayTime = this.caseForm.activateTime; //等于activateTime
					}
					if(this.currOper.operCode == "O50" ||this.currOper.operCode == "O53" || this.currOper.operCode == "O54" || this.currOper.operCode == "O55" || this.currOper.operCode == "O57"){
						if(this.ysTotime){
							param.prolongTime = parseInt(this.ysToLimittime)*60; //延时时长
						}
					}
				}
				if(this.currOper.operCode == "O59" ){
				   if(this.caseForm.yhPrice!=null){
						 this.$modal.msgError("该案件已养护完成，不能重复维修！");
						 return;
					 }
				}
				if(this.currOper.operCode == "O59" || this.currOper.operCode == "O60"){
				   param.bhId=this.caseForm.bhId;
				   param.trbId=this.caseForm.trbId;
				   param.yhUnit=this.caseForm.yhUnit;
				   param.roadId=this.caseForm.roadId;
				   param.yhLength=this.caseForm.yhLength;
				   param.yhPrice=this.caseForm.yhPrice;
				}
				if(this.currOper.operCode == "O45"){
					//逐级转派无法转派到当前账号机构
					if(param.nextOrgId==this.user.orgId){
						this.$modal.msgError("逐级转派无法转派到当前账号机构");
						return;
					}
				}
				param.needNotice = this.currOper.needNotice; //是否需要发送短信，直接传给后台
				let _this = this;
				this.$modal.loading("提交中。。。");
				uniRequest({
					method:'post',
					data:param,
					url:this.currOper.operUrl
				},function(res){
					_this.$modal.closeLoading();
					if(res.data.code == 200){
						_this.$modal.msgSuccess("提交成功");
						_this.getOpenerEventChannel().emit("refreshListEvent",{});
						setTimeout(function () {
							uni.navigateBack(0)
						}, 1000);
					}else{
						_this.$modal.msgError("提交失败:"+res.msg);
					}
				},function(e){
					_this.$modal.msgError("后台接口连接失败");
				})
			}
		},
		onLoad(options) {
			this.selectedCase = JSON.parse(options.selectedCase);
			this.caseForm = Object.assign({},this.selectedCase);
			this.caseId = this.selectedCase.caseId;
			//同步web端逻辑,是否上传附件由后台数据库配置
			if(this.selectedCase.linkForm){
				this[this.selectedCase.linkForm] = true;
			}
			//获取事件信息
			// this.getDetailInfo();
			//获取操作选项
			this.caseSignFor(this.caseId);
		},
		onNavigationBarButtonTap : function (e) {
			if(e.index == 0){//附件
				uni.navigateTo({
					url:'../case-attach/case-attach?caseId='+this.caseId
				})
			}else{//办理进度
				uni.navigateTo({
					url:'../case-process/case-process?caseId='+this.caseId
				})
			}
		},
	}
</script>

<style>
.uni-list {
    background-color: #fff;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
}
.uni-list-cell {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
.uni-list-cell-pd{
	padding: 11px 15px;
	justify-content: flex-start;
}
</style>
